<!--
 * @Author: your name
 * @Date: 2021-10-14 10:30:13
 * @LastEditTime: 2021-10-14 10:57:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /a1902-a-group/admin_pc/src/views/Editor/index.vue
-->
<template>
  <div>
      <el-button type="primary" @click="save">发布</el-button> 
      <v-md-editor
      v-model="text"
      toc-nav-position-right
    ></v-md-editor>
  </div>
</template>

<script>
export default {
    data() {
        return {
            isedit: false, // 判断是否为编辑功能
            text: '## 我是新增'
        }
    },
    created() {
        if(this.$route.query.id) {
            this.text = "## 我是编辑";
            this.isedit = true;
        }
    },
    methods: {
        save() {
            // 编辑功能
            if(this.isedit) {

            } else {
                // 新增
            }
        }
    },
}
</script>

<style>

</style>